import CustomUpload from '@/components/CustomUpload'
import { pageDesignModel } from '@/models/pageDesignModel'
import { observer } from 'mobx-react-lite'
import { ImageItemType } from '../../../../types/pageDesign'

const ImageItemSetting = () => {
  const item: ImageItemType = (pageDesignModel?.currentItem as ImageItemType) || { id: 0, type: 'image', url: '' }
  return (
    <>
      <CustomUpload onChange={(url) => pageDesignModel.setCurrentItem({ ...item, url: url })}>上传图片</CustomUpload>
    </>
  )
}

export default observer(ImageItemSetting)
